<template>
  <div>
  <div class="BrowsePage component-background">
    <header class="header">
      <div class="logo">
        <img :src="logo" alt="Dook学院论坛Logo" class="logo-image" />
      </div>
      <div class="nav-buttons">
        <el-button class="button" @click="toLogin()">登录</el-button>
        <el-button class="button" @click="toRegister()">注册</el-button>
        <el-button class="button" @click="toAboutUs()">关于我们</el-button>
      </div>
    </header>

      <main class="hero">
        <div class="city-background"></div>
        <div class="neon-grid"></div>
        <div class="tech-elements">
          <div class="tech-circle" style="width:200px;height:200px;top:20%;left:10%"></div>
          <div class="tech-circle" style="width:150px;height:150px;top:60%;right:15%"></div>
          <div class="tech-circle" style="width:300px;height:300px;bottom:10%;left:30%"></div>
        </div>

        <section class="intro">
          <h1>欢迎来到Dook学院</h1>
          <p>Dook学院是世界上最古老、最神秘的学府之一，拥有悠久的历史与丰富的文化底蕴。作为一所以培养精英人才为目标的学府，我们注重学术研究与实践能力的平衡发展。</p>
          <p>守夜人论坛是学院内部交流平台，所有发言都会被记录和归档。请谨记：<span class="motto">"毁灭与新生"</span></p>
          <div class="action-buttons">
            <el-button class="button enter-btn" @click="toLogin()">进入论坛</el-button>
            <el-button class="button dev-btn" onclick="location.href='https://space.bilibili.com/385328583?spm_id_from=333.999.0.0'">开发者空间</el-button>
          </div>
        </section>
      </main>

      <!-- 添加动态元素 -->
      <div class="floating-elements">
        <div class="float-element element1"></div>
        <div class="float-element element2"></div>
        <div class="float-element element3"></div>
        <div class="float-element element4"></div>
      </div>

      <div class="website-bottom">
          <div class="footer-content">
            <span class="footer-text">制作者:DC项目制作组</span>
            <span class="footer-divider">|</span>
            <span class="footer-text">© 2023 Dook学院</span>
          </div>
      </div>
  </div>
  </div>
</template>
<script>
import {logo} from "@/api/api";

export default {
    data() {
      return {
        logo: this.$store.state.logo,
      }
    },
  name: 'Laucher',
  methods: {
      async getlogo(){
          const response=await logo();
          console.log(response);
          if (response && response.data && response.data.message === "成功") {
              this.logo=response.data.data.url;
              this.$store.commit('addlogo', response.data.data.url);
          }
      },
    toLogin()  {
      this.$router.push("/login");
    },
    toRegister()  {
      this.$router.push("/register");
    },
    toAboutUs()  {
      this.$router.push("/aboutUs");
    }
  },
  mounted() {
      this.getlogo();
  }
}
</script>
<style>
:root {
    --primary-color: #1a1f3c;
    --accent-color: #4a90e2;
    --neon-color: #00ffff;
}

.component-background {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 31, 60, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 50px;
    transition: all 0.5s;
    filter: drop-shadow(0 0 5px var(--neon-color));
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--neon-color));
}

.nav-buttons {
    display: flex;
    gap: 20px;
}

.button {
    padding: 10px 20px;
    border: 2px solid var(--neon-color);
    border-radius: 5px;
    background: transparent;
    color: var(--neon-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.button:hover {
    background: var(--neon-color);
    color: var(--primary-color);
    box-shadow: 0 0 20px var(--neon-color);
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.button:hover::before {
    left: 100%;
}

.hero {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.city-background {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    z-index: -1;
}

.neon-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-color) 1px, transparent 1px),
                linear-gradient(var(--neon-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    z-index: -1;
}

.tech-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.tech-circle {
    position: absolute;
    border: 2px solid var(--neon-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.intro {
    max-width: 800px;
    text-align: center;
    padding: 40px;
    background: rgba(26, 31, 60, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--neon-color);
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px var(--neon-color);
    }
    to {
        box-shadow: 0 0 20px var(--neon-color), 0 0 30px var(--neon-color);
    }
}

.intro h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--neon-color);
    text-shadow: 0 0 10px var(--neon-color);
}

.intro p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #fff;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.enter-btn {
    background: var(--neon-color);
    color: var(--primary-color);
}

.dev-btn {
    background: transparent;
    color: var(--neon-color);
}

.website-bottom {
    text-align: center;
    padding: 20px 0;
    background: rgba(26, 31, 60, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: var(--neon-color);
}

.footer-text {
    font-size: 14px;
}

.footer-divider {
    opacity: 0.5;
}

.component-background {
    height: 1000px;
    width: 100%;
    background-image: url('https://cassell.oss-cn-beijing.aliyuncs.com/preview.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.component-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

/* 龙族元素装饰 */
.dragon-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.dragon-wing {
    position: absolute;
    width: 200px;
    height: 300px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
}

.left-wing {
    top: 100px;
    left: 50px;
    background-image: url('https://cassell.oss-cn-beijing.aliyuncs.com/dragon-wing.png');
    transform: scaleX(-1);
    animation: wing-flap 8s infinite alternate;
}

.right-wing {
    top: 100px;
    right: 50px;
    background-image: url('https://cassell.oss-cn-beijing.aliyuncs.com/dragon-wing.png');
    animation: wing-flap 8s infinite alternate-reverse;
}

@keyframes wing-flap {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(15deg); }
}

/* 学院徽章 */
.academy-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    z-index: 2;
    opacity: 0.8;
}

.badge-inner {
    width: 100%;
    height: 100%;
    position: relative;
    animation: badge-rotate 20s linear infinite;
}

.badge-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #051833, #1a3a6c);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(255, 89, 0, 0.5);
    border: 2px solid rgba(255, 89, 0, 0.3);
}

.badge-symbol {
    font-size: 60px;
    font-weight: bold;
    color: #ff5900;
    text-shadow: 0 0 10px rgba(255, 89, 0, 0.8);
}

@keyframes badge-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 学院特色元素 */
.academy-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    width: 120px;
}

.feature-item:hover {
    transform: translateY(-10px);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature-item i {
    font-size: 30px;
    color: #ff5900;
}

.feature-item span {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* 浮动元素 */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.float-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 89, 0, 0.2) 0%, rgba(255, 89, 0, 0) 70%);
    animation: float 15s infinite ease-in-out;
}

.element1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.element2 {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation-delay: -5s;
}

.element3 {
    width: 80px;
    height: 80px;
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

.element4 {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 50%;
    animation-delay: -7s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -20px) rotate(5deg); }
    50% { transform: translate(0, -40px) rotate(0deg); }
    75% { transform: translate(-20px, -20px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* 关于我们按钮样式 */
.aboutUs,
.aboutUs::after {
    padding: 16px 20px;
    font-size: 18px;
    background: linear-gradient(45deg, transparent 5%, #5054fc 5%);
    border: 0;
    color: #fff;
    letter-spacing: 3px;
    line-height: 1;
    box-shadow: 6px 0px 0px #00e6f6;
    outline: transparent;
    position: relative;
    cursor: pointer;
}

.aboutUs::after {
    --slice-0: inset(50% 50% 50% 50%);
    --slice-1: inset(80% -6px 0 0);
    --slice-2: inset(50% -6px 30% 0);
    --slice-3: inset(10% -6px 85% 0);
    --slice-4: inset(40% -6px 43% 0);
    --slice-5: inset(80% -6px 5% 0);
    content: "HOVER ME";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 3%, #00e6f6 3%, #00e6f6 5%, #1c85d0 5%);
    text-shadow: -3px -3px 0px #f8f005, 3px 3px 0px #00e6f6;
    clip-path: var(--slice-0);
}

.aboutUs:hover::after {
    animation: 1s glitch;
    animation-timing-function: steps(2, end);
}

@keyframes glitch {
    0% {
        clip-path: var(--slice-1);
        transform: translate(-20px, -10px);
    }

    10% {
        clip-path: var(--slice-3);
        transform: translate(10px, 10px);
    }

    20% {
        clip-path: var(--slice-1);
        transform: translate(-10px, 10px);
    }

    30% {
        clip-path: var(--slice-3);
        transform: translate(0px, 5px);
    }

    40% {
        clip-path: var(--slice-2);
        transform: translate(-5px, 0px);
    }

    50% {
        clip-path: var(--slice-3);
        transform: translate(5px, 0px);
    }

    60% {
        clip-path: var(--slice-4);
        transform: translate(5px, 10px);
    }

    70% {
        clip-path: var(--slice-2);
        transform: translate(-10px, 10px);
    }

    80% {
        clip-path: var(--slice-5);
        transform: translate(20px, -10px);
    }

    90% {
        clip-path: var(--slice-1);
        transform: translate(-10px, 0px);
    }

    100% {
        clip-path: var(--slice-1);
        transform: translate(0);
    }
}
</style>
